#ifndef SERVERDEFINES_H_
#define SERVERDEFINES_H_

typedef enum {FALSE, TRUE} BOOL;

/**
 * author: Assaf Paz
 * 
 * initializeServerConfiguration
 * 
 * numOfArguments - the amount of arguments in arguments
 * arguments - the command line argumets which can be:
 * 				-RTO n			total time before giving up
 * 				-RTT n			time between retries
 * 				-PORT n     	server port number
 * 				-MAX_CLIENTS	the maximum amount of simoultaneus clients
 * 
 * This function will initialize the server variables, first by reading the default
 * values, then override this values from the configuration file and last override
 * the values with values that were given from the command line.
 */
void initializeServerConfiguration(int numOfArguments, char* arguments[]);

/**
 * getRTT
 * 
 * get the time (in seconds) between retransmissions
 */
int getRTT();

/**
 * getRTO
 * 
 * get the maximum time (in seconds) of total retransmissions before giving up
 */
int getRTO();


/**
 * getTIMEUP
 * 
 * return zero by default
 */
int getTIMEUP();

/**
 * getPort
 * 
 * return the server port number to use for incoming requests
 */
int getPort();

/**
 * getMaxClients
 * 
 * return the Maximum amount of clients allowed allowed to be connected
 * simultaniously
 */
int getMaxClients();

/**
 * author: Assaf Paz.
 * 
 * setSignalHandler
 * 
 * sig - signal number
 * handler - a pointer to a function to be executed when a signal is caught
 * 
 * map a function to be run when a specific signal was caught
 */
void setSignalHandler(int sig, void (*handler)(int));

#endif /*SERVERDEFINES_H_*/
